home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / doc.zoo / doc / usrman / Makefile < prev    next >
Encoding:
Makefile  |  1989-04-03  |  3.0 KB  |  127 lines

  1. #                        Copyright (c) 1988 Bellcore
  2. #                            All Rights Reserved
  3. #       Permission is granted to copy or use this program, EXCEPT that it
  4. #       may not be sold for profit, the copyright notice must be reproduced
  5. #       on copies, and credit should be given to Bellcore where it is due.
  6. #       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  
  8. #    $Header: Makefile,v 4.7 88/07/21 12:51:08 sau Exp $
  9. #    $Source: /tmp/mgrsrc/doc/usrman/RCS/Makefile,v $
  10.  
  11. #        manual makefile
  12.  
  13. #    Directory to put the intermediate files
  14. TEMPDIR=.
  15. TEMPDIR=/tmp
  16.  
  17. #name of destination printer, as in $(TROFF) -T$(PRINTER) ...
  18. PRINTER=300
  19.  
  20. #name of temp file
  21. TEMP=$(TEMPDIR)/mgrman.$(PRINTER)
  22.  
  23. # Files needed to build manual
  24. PARTS= doc.0 doc.1 doc.2 doc.3 doc.4 doc.5 doc.6 $(TEMPDIR)/doc.7 $(TEMPDIR)/doc.8 doc.9
  25.  
  26. # files used to extract index 
  27. EXTRACT= doc.0 doc.1 doc.2 doc.3 doc.4 doc.5 doc.6
  28.  
  29. #    croff (c-source => troff input converter) directory and flags
  30. CROFF=./croff
  31. CRF=-k "" "" -c '\fI' '\fP'
  32.  
  33. VERSION = version
  34.  
  35. #    set to restrict range of printed pages
  36. RANGE=
  37.  
  38. #    Name of troff program 
  39. TROFF=ditroff
  40.  
  41. #    Name of troff print filter, that troffs and routes to a printer,
  42. #    all in one
  43. PRINT=redroff
  44.  
  45. #    where to install manual
  46. INSDIR=$(INSROOT)/doc
  47.  
  48. # what installed nroff'd manual is called
  49. NAME=usrman.out
  50.  
  51. FILES= README INDEX abstract version $(EXTRACT) doc.9
  52.  
  53. MAKE=make
  54. START=.
  55. CPIO=userman.cpio
  56.  
  57. ##########################################################
  58.  
  59. all:    abs print
  60.  
  61. fast small:    all
  62.  
  63. ver:
  64.         v=`cat $(VERSION)`;expr $$v + 1 > $(VERSION);\
  65.             echo .nr $$v > ver
  66.  
  67. print:    ver $(CROFF)/croff $(PARTS)
  68.         -tbl ver $(PARTS) | $(CROFF)/croff $(CRF) | \
  69.             $(PRINT) -ms $(RANGE) -
  70.  
  71. abs:    ver doc.0 abstract
  72.         cat ver doc.0 abstract | $(PRINT) -ms  -
  73.  
  74. $(TEMP).index:    $(EXTRACT)
  75.         @echo "extracting category list and index from document"
  76.         tbl ver $(EXTRACT)| $(CROFF)/croff $(CRF) | \
  77.             $(TROFF) -T$(PRINTER) -ms -rI1 >/dev/null 2> $(TEMP)
  78.         mv $(TEMP) $(TEMP).index
  79.  
  80. $(TEMPDIR)/doc.7:    $(TEMP).index
  81.         @echo "creating subject categories to $(TEMPDIR)/doc.7"
  82.         @grep "^.Fc" $(TEMP).index | \
  83.                 sort +2 -n  > $(TEMPDIR)/doc.7
  84.  
  85. $(TEMPDIR)/doc.8:    $(TEMP).index INDEX
  86.         @echo "building index to $(TEMPDIR)/doc.8"
  87.         sh INDEX  < $(TEMP).index  > $(TEMPDIR)/doc.8
  88.  
  89. #    nroff version
  90. nroff:
  91.         $(MAKE) TROFF=nroff PRINT=nroff PRINTER=$(PRINTER) all
  92.  
  93. install: $(INSDIR) $(NAME)
  94.         -rm -f $(INSDIR)/$(NAME)
  95.         -cp $(NAME) $(INSDIR)/$(NAME)
  96.         
  97. $(INSDIR):
  98.     -mkdir $@
  99.  
  100. $(NAME):
  101.     $(MAKE) -s PRINTER=crt nroff > $(NAME)
  102.  
  103. $(CROFF)/croff:
  104.     cd $(CROFF);$(MAKE) croff clean
  105.  
  106. clean:
  107.         rm -f $(TEMPDIR)/doc7 $(TEMPDIR)/doc8 $(TEMP).*
  108.         cd $(CROFF); $(MAKE) clean
  109.  
  110. clobber: clean
  111.         rm -f $(NAME)
  112.         cd $(CROFF); $(MAKE) clobber
  113.  
  114. list:
  115.     @for i in Makefile $(FILES) $(NAME); do \
  116.         echo "$(START)/$$i"; \
  117.     done    
  118.     @echo "$(START)/croff";
  119.     @if [ -d $(CROFF) ]; then \
  120.         cd $(CROFF); $(MAKE) START=$(START)/$(CROFF) list; \
  121.     fi
  122.  
  123. cpio:
  124.     $(MAKE) -s list | cpio -ocv > $(CPIO)
  125.  
  126. .PHONY:    all print ver install clean list clobber cpio nroff
  127.